namespace Crawler
{
	/// <summary>
	/// understands the working of a central factory 
	/// </summary>
	public class CentralFactory : ICentralFactory
	{
		public static ICentralFactory centralFactory = new CentralFactory();
		private IUrlStack urlStack;
		private IResourcePath cacheResourcePath;
		private IDownloadStore downloadStore;
		public IMapper mapper;
		public IResourcePath resourcePath;
		public string domain;
		public bool isUrlStackEmpty = false;


		private CentralFactory()
		{
		}

		public IUrlStack GetUrlStack()
		{
			return urlStack;
		}

		public IResourcePath GetCachePath()
		{
			return cacheResourcePath;
		}

		public IResourcePath GetPath()
		{
			return resourcePath ;
		}

		public IDownloadStore GetDownloadStore() 
		{
			return downloadStore;
		}

		public IMapper GetMapper()
		{
			return mapper;
		}

		public string GetDomain() {
			return this.domain;
		}

		public void Add(IUrlStack urlStack)
		{
			this.urlStack = urlStack;
		}

		public void Add(IDownloadStore downloadStore)
		{
			this.downloadStore = downloadStore;
		}

		public void AddCachePath(IResourcePath path)
		{
			this.cacheResourcePath = path;
		}

		public void Add(IResourcePath path)
		{
			this.resourcePath = path;
		}

		public void Add(IMapper mapper)
		{
			this.mapper = mapper;
		}

		public void Add(string domain)
		{
			this.domain = domain;
		}
	}
}
